<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="../../../object/coreObject/fix/FixArticleTypeObj.js"></script>
<title></title>
</head>
<body>
<script LANGUAGE="javascript">
var fixArticleTypeObj = new FixArticleTypeObj();

var url = "../../article.php?type=";
function redirectPageComplete(type)
{	
	alert("ลบบทความสำเร็จ");
	location = url+type;
}

function redirectPageIncomplete(type)
{
	alert("เกิดข้อผิดพลาดในการลบข้อมูล");
	location = url+type;
}

function redirectPageIsnull(type)
{
	alert("ข้อมูลบางส่วนยังเป็น่ค่าว่าง กรุณาลงใหม่อีกครั้ง");
	location = url+type;
	
}

<?php
include '../../../dbconfig.php';
$id = addslashes($_GET['article_id']);
$type = addslashes($_GET['article_type']);
if(isset($id)){
	$sql = "DELETE FROM article	WHERE article_id=$id";
	if(mysql_query($sql)){
	 	echo "redirectPageComplete($type);";
	}else{	
		echo "redirectPageIncomplete($type);";
	}	
	mysql_close();	
}
else
{
	echo "redirectPageIsnull($type);";
}
?>
</script>
</body>
</html>
